Conversation
…t_interval_secs to TOML templates Sort searched tags before emitting per-tag INNER JOINs so the same search always yields the same SQL text (keeps SQLite prepare_cached effective and query logs comparable), and document the new metrics_count_interval_secs option in the tarball/package TOML templates (server config sync rule). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BEWGdmu3aN8ZgShtDV7etc
…plates Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BEWGdmu3aN8ZgShtDV7etc
|
Other jobs that need cloud credentials (for example Generated by Claude Code |
|
Three more checks failed, and like
No fix exists in code for any of these. They need this fork's Actions secrets and network access to the HSM, or they can simply be ignored in the fork. A re-run would fail the same way, so I am not re-running them. The checks for this change (clippy, SQLite on Linux, macOS and ARM, and Windows) are green. I'll keep watching the database test jobs. Generated by Claude Code |
|
Status on
None of these can be fixed in code, so I'm not re-running them. Still running: Generated by Claude Code |
Summary
Follow-up to Cosmian#1224 after review.
The base branch
fix/postgresqlin this fork is a copy of the head of Cosmian#1224 (Cosmian:fix/postgresql@45be9904), so this diff contains only the review fixes. To merge them into Cosmian#1224, open the upstream PR:https://github.com/Cosmian/kms/compare/fix/postgresql...Manuthor:kms:claude/jolly-volta-85qy24?expand=1
select_from_objectsemitted oneINNER JOIN tags tNper tag while iterating theHashSetreturned byAttributes::get_tags. That gave the same search a different SQL text on each call, which wastes SQLite'sprepare_cachedstatement cache and makes query logs hard to compare. Tags are now sorted before the joins are emitted. Added a unit test,tag_joins_are_bound_in_sorted_order.metrics_count_interval_secsoption was only inresources/kms.toml. It is now also documented, commented out, incrate/server/kms_template.tomlandpkg/kms.toml. No wizard step was added, because the similar options (auto_rotation_check_interval_secs,keyset_warn_depth) have none.CHANGELOG/fix_postgresql.mdupdated accordingly.Review notes on Cosmian#1224 (no change needed)
INNER JOINgives the same results as the oldGROUP BY … HAVING COUNT(DISTINCT tag), because each join probesUNIQUE (id, tag), so no row can be repeated.LIMITpushdown is disabled when rows are filtered after the query (non-admin HSM visibility), so a page never comes back short.?placeholders are bound in the same order as they appear in the SQL text.::jsonbcast on ajsonbcolumn is dropped and the column is converted tojsonbat startup, before the indexes are created. The SQLiteRotateAutomatic = 1partial-index predicate matchesBOOL_TRUE_LITERAL.metrics_count_interval_secs = 0disables theselect!arm;max(1)avoids the panic on a zerointerval.Testing
cargo test -p cosmian_kms_server_database --lib -- sqlite locate_query: 7/7 passed, includingtest_db_sqlite, which runs the newfind_with_options_test/count_non_destroyed_keys_testand thePRAGMA optimizestartup path.cargo clippy -p cosmian_kms_server_database --all-targets -- -D warnings: clean.lycheewas skipped with the maintainer's OK: it checks every link indocumentation/docs, and some external hosts are unreachable from the sandbox.🤖 Generated with Claude Code
https://claude.ai/code/session_01BEWGdmu3aN8ZgShtDV7etc